package cn.lingyan.dao;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import java.io.Serializable;
import java.util.List;

public class CommonDAOHibImpl extends HibernateDaoSupport implements CommonDAO {
    @Override
    public Object get(Class clazz, Serializable id) {
        return super.getHibernateTemplate().get(clazz,id);
    }

    @Override
    public Serializable add(Object o) {
        Serializable ret=super.getHibernateTemplate().save(o);
        return ret;
    }

    @Override
    public void del(Class clazz, Serializable id) {
        super.getHibernateTemplate().delete(this.get(clazz,id));
    }

    @Override
    public void update(Object o) {
        super.getHibernateTemplate().update(o);
    }

    @Override
    public List search(String hql) {
        List ret= super.getHibernateTemplate().find(hql);
        return ret;
    }
}
